package com.sias.realestate.web.service.impl;


import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sias.realestate.core.generic.GenericDao;
import com.sias.realestate.core.generic.GenericServiceImpl;
import com.sias.realestate.web.dao.ChargeMapper;
import com.sias.realestate.web.model.Charge;
import com.sias.realestate.web.service.ChargeService;

@Service
public class ChargeServiceImpl extends GenericServiceImpl<Charge, Integer> implements ChargeService{

	@Resource
	private ChargeMapper chargemapper;
	
	
	@Override
    public int insert(Charge model) {
        return chargemapper.insertSelective(model);
    }

    @Override
    public int update(Charge model) {
        return chargemapper.updateByPrimaryKeySelective(model);
    }

    @Override
    public int delete(Integer id) {
        return chargemapper.deleteByPrimaryKey(id);
    }

    @Override
    public Charge selectById(Integer id) {
        return chargemapper.selectByPrimaryKey(id);
    }
    
	@Override
	public List<Charge> selectList() {
		// TODO Auto-generated method stub		
		return chargemapper.selectAll();
	}

	@Override
	public GenericDao<Charge, Integer> getDao() {
		// TODO Auto-generated method stub
		return chargemapper;
	}

	@Override
	public List<Charge> findChargeByOid(Integer oid) {
		// TODO Auto-generated method stub
		return chargemapper.selectByOid(oid);
	}

	@Override
	public List<Charge> findChargeByOidAndOther(Integer oid, String cType, String cStatus, Date cTime) {
		// TODO Auto-generated method stub
		return chargemapper.selectByOidIf(oid, cType, cStatus, cTime);
	}

	@Override
	public Charge findChargeByCid(Integer cid) {
		// TODO Auto-generated method stub
		return chargemapper.selectByCid(cid);
	}

}
